package com.engine.salary.enums.salaryformula;


import com.engine.salary.enums.BaseEnum;

import java.util.Objects;

/**
 * 薪资项目公式引用分类
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum SalaryFormulaReferenceEnum implements BaseEnum<String> {

    SALARY_ITEM("salaryItem", "薪资项目", 84960),
    //    SALARY_ITEM_OF_HISTORY("salaryItemOfHistory", "历史台账薪资项目", 85364),
    LAST_MONTH_CALC("lastMonthCalc", "上月核算", 257728),
    EMPLOYEE_INFO("employeeInfo", "员工基本信息", 85366),
    SALARY_ARCHIVES("salaryArchives", "薪资档案", 85368),
    ATTEND("attend", "考勤引用", 85367),
    ADD_UP_SITUATION("addUpSituation", "往期累计情况", 104412),
    ADD_UP_DEDUCTIONS("addUpDeductions", "累计专项附加扣除", 85380),
    WELFARE("welfare", "社保福利", 87522),
    OTHER_DEDUCTION("otherDeduction", "其他免税扣除", 93849),
    SALARY_ACCT_EMPLOYEE("salaryAcctEmployee", "核算基本信息", 85368),
    SALARY_CYCLE("SalaryCycle", "核算日期", 85368),
    VARIABLE_ITEM("variableItem", "浮动薪资项目", 0),
    ISSUED("ISSUED", "已发", 0);

    private String value;

    private String defaultLabel;

    private int labelId;

    SalaryFormulaReferenceEnum(String value, String defaultLabel, int labelId) {
        this.value = value;
        this.defaultLabel = defaultLabel;
        this.labelId = labelId;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDefaultLabel() {
        return defaultLabel;
    }

    @Override
    public Integer getLabelId() {
        return labelId;
    }

    public static SalaryFormulaReferenceEnum parseByValue(String value) {
        for (SalaryFormulaReferenceEnum referenceEnum : SalaryFormulaReferenceEnum.values()) {
            if (Objects.equals(referenceEnum.getValue(), value)) {
                return referenceEnum;
            }
        }
        return null;
    }
}
